<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Product extends MY_Controller
{
    /**
     * Index Page for this controller.
     */
    public function index()
    {
        $this->load->library('c_history');

        $sendData = array();
        $sendData['enterpriseId'] = $this->lg_user['enterpriseId'];
        $sendData['channelId'] = $this->lg_user['channelId'];
        $sendData['userType'] = $this->lg_user['type'];
        $sendData['uid'] = $this->lg_user['id'];
        $sendData['password'] = $this->lg_user['password'];

        //制造接口请求
        $url = $this->c_history->set_call_items($sendData);
        $param = $this->c_history->get_call_items();
        $rs = $this->restcurl->get($url, $param);
        if ($rs && $rs['ErrorCode'] == 0 && $rs['Success'] == 1) {
            $this->c_history->set_back_items($rs['CallInfo']);
        }
        $CallInfo = $this->c_history->get_back_items();
        $productList = isset($CallInfo['product_list']) ? $CallInfo['product_list'] : array();
        $this->data['ProductData'] = $productList;
        $this->render('ucenter/product/index', $this->data);
    }
}
